﻿namespace SDT.CrawlSystem.Servers
{
    /// <summary>
    /// Written by TungNX
    /// </summary>
    public sealed partial class UrlLoader
    {
        public enum Status
        {
            NA = 0, NEW = 1, SUCCESS = 2, INVALID = 3, ACCESS_DENY = 4, TIMEOUT = 5, NOT_FOUND = 6, OFFLINE = 7
        };

        private Status FromString(string str)
        {
            switch (str)
            {
                case "NEW":
                    return Status.NEW;
                case "SUCCESS":
                    return Status.SUCCESS;
                case "INVALID":
                    return Status.INVALID;
                case "ACCESS_DENY":
                    return Status.ACCESS_DENY;
                case "TIMEOUT":
                    return Status.TIMEOUT;
                case "NOT_FOUND":
                    return Status.NOT_FOUND;
                case "OFFLINE":
                    return Status.OFFLINE;
                default:
                    return Status.NA;
            };
        }
    }
}